﻿using System.Windows.Input;

namespace KinonekoSoftware.Foundation.UI.Controls.Buttons
{
    public class DropDownButton : ForestComboBoxBase
    {
        public static readonly DependencyProperty CommandProperty;
        public static readonly DependencyProperty CommandParameterProperty;
        public static readonly DependencyProperty CommandTargetProperty;
        
        /*
            ICommand Command { get; }
            object CommandParameter { get; }
                IInputElement CommandTarget { get; }
         */
        
        static DropDownButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(DropDownButton), new FrameworkPropertyMetadata(typeof(DropDownButton)));
            
            CommandProperty = DependencyProperty.Register(
                nameof(Command),
                typeof(ICommand),
                typeof(DropDownButton),
                new PropertyMetadata(default(ICommand)));
            
            CommandParameterProperty = DependencyProperty.Register(
                nameof(CommandParameter),
                typeof(object),
                typeof(DropDownButton),
                new PropertyMetadata(default(object)));
            CommandTargetProperty = DependencyProperty.Register(
                nameof(CommandTarget),
                typeof(IInputElement),
                typeof(DropDownButton),
                new PropertyMetadata(default(IInputElement)));
        }




        //------------------------------------------------
        //
        //  Properties
        //
        //------------------------------------------------
        

        public IInputElement CommandTarget
        {
            get => (IInputElement)GetValue(CommandTargetProperty);
            set => SetValue(CommandTargetProperty, value);
        }

        public object CommandParameter
        {
            get => GetValue(CommandParameterProperty);
            set => SetValue(CommandParameterProperty, value);
        }

        public ICommand Command
        {
            get => (ICommand)GetValue(CommandProperty);
            set => SetValue(CommandProperty, value);
        }
    }
}